package com.heima.wemedia.feign;


import com.heima.apis.wemedia.IWemediaFeign;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojo.WmUser;
import com.heima.wemedia.service.WmUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * 远程feign接口调用
 */
@RestController
@Api("自媒体用户远程调用")
public class WeMediaFeign implements IWemediaFeign {

    @Autowired
    WmUserService wmUserService;

    @ApiOperation("保存自媒体用户")
    @Override
    public ResponseResult save(WmUser wmUser) {
        return wmUserService.insert(wmUser);
    }

    @ApiOperation("查询自媒体用户")
    @Override
    public WmUser findByName(String name) {
        return wmUserService.findByName(name);
    }
}
